#ifndef __HAL_UART_H
#define __HAL_UART_H

#include <stdio.h>
#include "t_types.h"

#define HAL_UART_MAX_CHANNEL	(6)
#define HAL_UART_DEV_NAME_LEN	(64)
#define HAL_UART_APP_NAME_LEN	(32)

#define HAL_UART_APP_NAME_CR	"CardReader"
#define HAL_UART_APP_NAME_MCU	"Mcu"
#define HAL_UART_APP_NAME_RSU	"RSU"

typedef unsigned long HAL_UART_HANDLE;

typedef struct _HAL_UART_CHANNEL_CONFIG_S
{
	unsigned int u32Enable;
	char au8DevName[HAL_UART_DEV_NAME_LEN];
	unsigned int u32BaudRate; // 2400, 9600,115200 ...
	char as8AppName[HAL_UART_APP_NAME_LEN];
} HAL_UART_CHANNEL_CONFIG_S;

typedef struct _HAL_UART_CONFIG_S
{
	HAL_UART_CHANNEL_CONFIG_S astUartChannel[HAL_UART_MAX_CHANNEL];
} HAL_UART_CONFIG_S;

typedef struct _HAL_UART_CB_PARAM_S
{
	int s32Len;
	unsigned char *pu8Buff;
} HAL_UART_CB_PARAM_S;

int HAL_UART_Init(void);
int HAL_UART_DeInit(void);
int HAL_UART_RegisterRecvCallback(int s32Chn, T_CALLBACK fnCb);
int HAL_UART_unRegisterRecvCallback(int s32Chn);
int HAL_UART_Probe(char *ps8AppName);
int HAL_UART_Send(int s32Chn, unsigned char *pu8Data, int s32Len);
int HAL_UART_Recv(int s32Chn, unsigned char *pu8Data, int s32Len);

#endif
